<template>
  <div style="width: 100%; height: 100vh">
    <div style="height: 50px">
      <span style="color: #131513; font-size: 24px;margin-left: 20px">定额表-并条</span>
      <a-space style="float: right">
        <a-icon @click="refresh" type="redo" style="cursor: pointer" />
        <!-- <a-icon @click="retract" type="column-height" style="cursor: pointer" /> -->
        <!-- <a-icon @click="setting" type="setting" style="cursor: pointer; margin-right: 30px" /> -->
        <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
        <a-button @click="batchDel" type="default">删除</a-button>
        <a-button @click="btnImport" type="default">导入</a-button>
        <a-button @click="btnExport" type="default">导出</a-button>
      </a-space>
    </div>
    <!-- <tm-area-modal ref="modalForm" @ok="modalFormOk"></tm-area-modal> -->
    <div style="background: #ffffff; border-radius: 5px; padding: 20px; padding-bottom: 100px; position: relative">
      <a-table
        :scroll="{ x: true }"
        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
        :columns="columns"
        :data-source="dataSource"
        rowKey="id"
        :loading="loading"
        :pagination="ipagination"
        @change="handleTableChange"
      >
        <!-- 操作 -->
        <a-space slot="action" slot-scope="text, record">
          <template>
            <a-button style="padding: 0px" type="link" icon="edit" @click="handleEdit(record)">编辑</a-button>
            <a-popconfirm title="确认要删除吗?" @confirm="() => handleDelete(record.id)">
              <a-button style="color: red; padding: 0px" type="link" icon="delete">删除</a-button>
            </a-popconfirm>
          </template>
        </a-space>
      </a-table>

      <span style="position: absolute; bottom: 10px; right: 20px">{{ ipagination.total }}结果</span>
    </div>
    <!-- 表单区域 -->
    <bingtiao-modal ref="modalForm" @ok="modalFormOk"></bingtiao-modal>
  </div>
</template>

<script>
// import { dateDeparatorChange } from "@/utils/myUtils/dateToFormat"
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import BingtiaoModal from './modules/BingtiaoModal'
const path = '/crm_product_type_drawing/crmProductTypeDrawing'
export default {
  mixins: [JeecgListMixin],
  components: { BingtiaoModal },
  data() {
    return {
      columns: [
        {
          title: '工序',
          dataIndex: 'workingProcedure_dictText',
          align: 'center',
          fixed: 'left'
        },
        {
          title: '品种代号',
          dataIndex: 'productCode',
          align: 'center'
        },
        {
          title: '品名',
          dataIndex: 'productType',
          align: 'center'
        },
        {
          title: '品种全称',
          dataIndex: 'productTypeFullName',
          align: 'center'
        },
        {
          title: '品种',
          dataIndex: 'productCategory',
          align: 'center'
        },
        {
          title: '纺纱方式',
          dataIndex: 'spinningMethod',
          align: 'center'
        },
        {
          title: '类别',
          dataIndex: 'category',
          align: 'center'
        },
        {
          title: '品种批号',
          dataIndex: 'productBatch',
          align: 'center'
        },
        {
          title: '品种支别',
          dataIndex: 'productBranch',
          align: 'center'
        },
        {
          title: '锭数',
          dataIndex: 'ingots',
          align: 'center'
        },
        {
          title: '定量换数系数',
          align: 'center',
          children: [
            {
              title: '棉',
              dataIndex: 'commutationCotton',
              align: 'center'
            },
            {
              title: '其它',
              dataIndex: 'commutationOther',
              align: 'center'
            },
            {
              title: '综合',
              dataIndex: 'commutationComprehensive',
              align: 'center'
            }
          ]
        },
        {
          title: '定量',
          dataIndex: 'ration',
          align: 'center'
        },
        {
          title: '车速',
          dataIndex: 'speed',
          align: 'center'
        },
        {
          title: '效率',
          dataIndex: 'efficiency',
          align: 'center'
        },
        {
          title: '长度百米',
          dataIndex: 'length',
          align: 'center'
        },
        {
          title: '重量 KG/日/台',
          dataIndex: 'weight',
          align: 'center'
        },
        {
          title: '单锭重量 KG/日/台',
          dataIndex: 'ingotWeight',
          align: 'center'
        },
        {
          title: '重量时间单位',
          dataIndex: 'weightTimeUnit',
          align: 'center'
        },
        {
          title: '定额看台',
          dataIndex: 'fixedMachinesNum',
          align: 'center'
        },
        {
          title: '损耗率',
          dataIndex: 'lossRate',
          align: 'center'
        },
        {
          title: '实际车速',
          dataIndex: 'actualSpeed',
          align: 'center'
        },
        {
          title: '管色',
          dataIndex: 'tubeColor',
          align: 'center'
        },
        {
          title: '内袋',
          dataIndex: 'innerPocket',
          align: 'center'
        },
        {
          title: '捆绳',
          dataIndex: 'twine',
          align: 'center'
        },
        {
          title: '外袋',
          dataIndex: 'outPocket',
          align: 'center'
        },
        {
          title: '成包标准毛重',
          dataIndex: 'standardGrossWeight',
          align: 'center'
        },
        {
          title: '操作',
          align: 'center',
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: path + '/list',
        delete: path + '/delete',
        deleteBatch: path + '/deleteBatch'
        // toDetail: '/personnelInformation/modules/blacklistDetails'
      }
    }
  },
  mounted() {},
  methods: {
    refresh() {
      this.searchQuery()
    },
    handleSearch() {
      this.searchQuery()
      this.visible = false
    },
    handleCancel() {
      this.visible = false
    },
    handleReset() {
      this.searchReset()
    },
    add() {
      this.visable1 = true
    },
    detail(record) {},
    onChangePage(e) {
      this.ipagination.current = e
      this.loadData()
    },
    btnImport() {},
    btnExport() {}
    // dateChange(data) {
    //   return dateDeparatorChange(data)
    // }
  }
}
</script>

<style></style>
